#ifndef		GUI__Image_h
#define		GUI__Image_h

#include	"Control.h"
#include	<OpenGL/Color.h>
#include	<Textures/Texture.h>
#include	<string>
#include	<vector>

class Image : public Control
{
public:
	Image(
		Window * window,
		Mouse * mouse,
		const Vector2i & position,
		const Vector2i & size,
		const std::vector< Texture * > & textures,
		const Vector2i & imagePosition = Vector2i(-1, -1),
		const Vector2i & imageSize = Vector2i(-1, -1),
		const Vector2i & texTopLeft = Vector2i(-1, -1),
		const Vector2i & texBottomRight = Vector2i(-1, -1),
		const Color & color = Color(1.0f, 1.0f, 1.0f, 1.0f),
		const Color & backgroundColor = Color(0.0f, 0.0f, 0.0f, 0.0f),
		bool visible = true,
		const Vector2i & windowSize = Vector2i(800, 600),
		Control * transfer = 0
		);
	virtual ~Image();
	virtual void message(int id, void * parameter);
	virtual void updateAnimation(double delay);
	virtual void render() const;
public:
	const std::vector< Texture * > & getTextures() const;
	std::vector< Texture * >::size_type getTexture() const;
	const Vector2i & getImagePosition() const;
	const Vector2i & getImageSize() const;
	const Vector2i & getTexTopLeft() const;
	const Vector2i & getTexBottomRight() const;
	const Color & getColor() const;
	Control * getTransfer() const;
	void setTextures(std::vector< Texture * > & textures);
	void setTexture(std::vector< Texture * >::size_type texture);
	void setImagePosition(const Vector2i & imagePosition);
	void setImageSize(const Vector2i & imageSize);
	void setTexTopLeft(const Vector2i & texTopLeft);
	void setTexBottomRight(const Vector2i & texBottomRight);
	void setColor(const Color & color);
	void setTransfer(Control * transfer);
private:
	std::vector< Texture * > m_textures;
	std::vector< Texture * >::size_type m_texture;
	Vector2i m_imagePosition;
	Vector2i m_imageSize;
	Vector2i m_texTopLeft;
	Vector2i m_texBottomRight;
	Color m_color;
	Color m_backgroundColor;
	Control * m_transfer;
};

#endif	//	GUI__Image_h

